﻿var gviewport; // global viewport


var homePanel; //= new Ext.ux.IFrameComponent({ id: 'panelHome' ,url:'/home/viewHome'});
var menuBarPanel; //= new Ext.ux.IFrameComponent({ id: 'panelHome' ,url:'/home/viewHome'});
var menuInfoPanel; //= new Ext.ux.IFrameComponent({ id: 'panelHome' ,url:'/home/viewHome'});
var reportPanel; //= new Ext.ux.IFrameComponent({ id: 'panelHome' ,url:'/home/viewHome'});v
var tabInfoPanel;
var mainPage;

var CurrentPage = {
    page: undefined,
    title: '',
    id: ''
};

function movein(which, type, desc) {
    var e = document.getElementById("boxdescription");
    if (type == 1) {
        which.style.background = 'url(images/customer/bg_lap.gif) repeat';
        which.style.border = '1px solid #28166f';
    } else {
    which.style.background = '#28166f';
        which.style.border = '1px solid #28166f';
    }
    which.style.cursor = 'hand';
    if (desc != null) {
        if (e != null) {
            e.style.border = '1px dotted #ccc';            
            e.innerHTML = desc;
       } else {
			boxdescription.innerHTML = desc
		}
	}
};

function moveout(which) {
    var e = document.getElementById("boxdescription");
    which.style.background = 'none';
    which.style.border = 'none';
    which.style.cursor = 'hand';
    if (e != null) {
		 document.getElementById("boxdescription").innerHTML = '&nbsp;'
	} else { 
		//boxdescription.innerHTML = '&nbsp;' 
	}
};

Ext.onReady(function() {

   
    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
	var varTmp = "logoff.aspx";
	var htmlHeader = '<table width=100% height=85 border=0 bgcolor=#28166f cellpadding=0 cellspacing=0>';
	htmlHeader += '<tr>';
	htmlHeader += '<td width=90%><img src=""></td>';
	htmlHeader += '<td><table border=0 height=100%><tr height=50%><td></td></tr>';
	htmlHeader += '<tr><td class="userlogin" nowrap><i>Log in as : </i><img src="images/icons/fam/user_orange.png" hspace=5  align="absmiddle"><b>' + strUser;
	htmlHeader += ', &nbsp;&nbsp;<a href="' + varTmp + '"><img src="" hspace=5 align="absmiddle"><i>Log off</i></a>' + '</b>&nbsp;&nbsp;</td></tr></table>';
	htmlHeader += '</td></tr>';
	htmlHeader += '</table>'; 
    var pnlHeader = new Ext.BoxComponent({
        region: 'north',
        height: 95, 
        margins: '0 0 0 0',
        autoEl: {
            tag: 'div',
            html: htmlHeader
        }
    });
   
    
    menuBarPanel = new Ext.Panel({
        region: 'west',
        id: 'west-panel', // see Ext.getCmp() below
        title: 'Transaction',
        split: true,
        width: 175,
        minSize: 175,
        maxSize: 200,
        collapsible: true,
        margins: '0 0 0 5',
        layout: {
            type: 'accordion',
            animate: false
        }
       
    });
	
 
    var pnlStatus = {
       
        region: 'south',
    
        margins: '5 0 0 0',
        height: 25,
        //autoHeight: true,
        layout: 'fit',
        bbar: new Ext.ux.StatusBar({
            id: 'bar-status'
        
        })
    };
	
	var htmlLap = '<table cellpadding="0" cellspacing="3" border="0" width=100% height=100% class="rptmenu">';
		htmlLap += '<tr height=80%><td valign=top>';
		htmlLap += '<table cellpadding="0" cellspacing="1" border="0" width=100% class="rptmenu">';
		//isi
		htmlLap += '<tr><td><img src="../images/default/s.gif" height=400 width=1 border=1></td></tr>';
		//---
		htmlLap += '</table>';
		htmlLap += '</td></tr>';
	
		htmlLap += '<tr><td id="boxdescription" valign="top" class="text-desc">';
		htmlLap += '</td></tr>';
		htmlLap += '</table>';
		
		
	tabInfoPanel=new Ext.Panel
	({
		border: false, 
		items: 
			[{
				id: 'Report-content',
				html: htmlLap,
				
				layout: 'FORM',
				autoScroll: true
			}]

	})

	menuInfoPanel= new Ext.Panel({
		region: 'east',
		id: 'east-panel', 
		title: 'Laporan',
		collapsible: true,
		split: true,
		width: 225, 
		minSize: 175,
		maxSize: 400,
		margins: '0 5 0 0',
		layout: 'FORM', 
		autoScroll: true,
		bodyStyle: 'background: url("../images/customer/bg_leftmenu_customer.png");',
		items: [tabInfoPanel]           
    });

    gviewport = new Ext.Viewport({
        layout: 'border',
		items: [pnlHeader, menuBarPanel, getMainPanelData(),pnlStatus]
    });

 
    
    Login(strUser);
	show_clock();

}); 